/**
 * $Id: winver.c,v 1.1 2001/03/08 03:46:06 mvines Exp $
 *
 * Copyright (C) 2001  Michael Vines
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
#include <windows.h>
#include <stdio.h>
#include "winver.h"

enum WinVersions winVersion;

void get_winver(int show)
{
  OSVERSIONINFO vi;

  vi.dwOSVersionInfoSize = sizeof(vi);

  if (!GetVersionEx(&vi)) {
    printf("ERROR: Unable to determine OS version\n");
    exit(-1);
  }

  if (VER_PLATFORM_WIN32_NT == vi.dwPlatformId) {
    winVersion = _WINNT;
  } else if (VER_PLATFORM_WIN32_WINDOWS == vi.dwPlatformId) {
    winVersion = (0 == vi.dwMinorVersion) ? _WIN95: _WIN98;
  } else {
    printf("ERROR: Unknown Windows version\n");
    exit(-1);
  }
  
  if (!show) return;
  
}
